﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _013
{
    internal class Program
    {
        static void Main(string[] args)
        {
            #region
            /*
            int num = 12;
            if(num%2==0)
            {
                Console.WriteLine("{0}是偶数",num);
            }
            else
            {
                Console.WriteLine("{0}是奇数", num);
            }

            Console.WriteLine("请输入学生的成绩：");
            int num1 = Convert.ToInt32(Console.ReadLine());
            if(num1>=0 && num1<60)
            {
                Console.WriteLine("不及格！");
            }
            else if(num1>=60 && num1<70)
            {
                Console.WriteLine("及格");
            }
            else if(num1>=70 && num1<80)
            {
                Console.WriteLine("中等");
            }
            else if(num1>=80 && num1<90)
            {
                Console.WriteLine("良好");
            }
            else if(num1>=90 && num1<100)
            {
                Console.WriteLine("优秀");
            }
            */
            #endregion
            #region
            /*
            Console.WriteLine("请输入你的成绩");
            int num = Convert.ToInt32(Console.ReadLine());
            switch(num/10)
            {
                case 10:
                    Console.WriteLine("优秀");
                    break;
                case 9:
                    Console.WriteLine("中上");
                    break;
                case 8:
                    Console.WriteLine("中等");
                    break;
                case 7:
                    Console.WriteLine("中下");
                    break;
                case 6:
                    Console.WriteLine("及格");
                    break;
                default:
                    Console.WriteLine("不及格");
                    break;
            }
            Console.WriteLine("请输入Yes/No");
            */
            #endregion
            #region
            /*
            string str = " ";
            int i;
            int j;
            int sum;
            for(i=1;i<10;i++)
            {
                for(j=1;j<=i;j++)
                {
                    sum = i * j;
                    Console.Write(j);
                    Console.Write("*");
                    Console.Write(i);
                    Console.Write("=");
                    Console.Write(sum);
                    Console.Write(str);
                }
                Console.WriteLine();
            }
            Console.Read();
            */
            #endregion
            #region
            /*
            for (int i=0;i<=10;i++)
            {
                for(int j=0;j<10-i;j++)
                {
                    Console.Write("   ");
                }
                for(int k=0;k<2*i-1;k++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
            for(int i=0;i<=9;i++)
            {
                for(int j=0;j<=i;j++)
                {
                    Console.Write("  ");
                }
                for(int k=0;k<17-2*i;k++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
            */
            #endregion
            #region
            /*
            for (int i=1;i<=9;i++)
            {
                for(int j=1;j<=i;j++)
                {
                    Console.Write("{0}x{1}\t", j, i, i * j);
                }
                Console.WriteLine();
            }

            for(int i=1;i<=9;i++)
            {
                for(int j=1;j<=i;j++)
                {

                    Console.Write("{0}x{1}\t", j, i, i * j);
                }
                Console.WriteLine();
            }
            */
            #endregion
            #region
            /*
            int i = 123456;
            float f = 11.23f;
            Console.WriteLine("{0:C}",i);//货币形式
            Console.WriteLine("{0:D}",i);//十进制形式
            Console.WriteLine("{0:E}",i);//科学计数法
            Console.WriteLine("{0:F}",i);//浮点类型表示法（精确小数点后两位）
            Console.WriteLine("{0:G}",i);//常用格式
            Console.WriteLine("{0:N}",i);//用逗号分隔千位的数字
            Console.WriteLine("{0:P}",i);//百分符号格式
            */
            #endregion
            #region
            /*
            Console.WriteLine("{0:D}",DateTime.Now);//输出到天(长日期）
            Console.WriteLine("{0:d}", DateTime.Now);//输出到天（短日期）
            Console.WriteLine("{0:F}",DateTime.Now);//输出到年月日分秒（全日期）
            Console.WriteLine("{0:f}", DateTime.Now);//输出到年月日分（短日期）
            Console.WriteLine("{0:Y}",DateTime.Now);//输出到月
            Console.WriteLine("{0:G}",DateTime.Now);//输出到年月日分秒（短日期）
            Console.WriteLine("{0:g}", DateTime.Now);//输出到年月日分（短日期）
            Console.WriteLine("{0:M}",DateTime.Now);//输出月日
            Console.WriteLine("{0:r}",DateTime.Now);//(RFC1123模式）
            Console.WriteLine("{0:s}",DateTime.Now);//使用本地时间的可排序模式
            Console.WriteLine("{0:T}",DateTime.Now);//输出到秒
            Console.WriteLine("{0:t}",DateTime.Now);//输出到分
            Console.WriteLine("{0:tt}",DateTime.Now);//输出是上午/还是下午
            Console.WriteLine("{0:U}",DateTime.Now);//通用可排序模式
            */
            #endregion
            #region
            /*
            int k = 0;
            Console.WriteLine("------------------全乘法表------------------");
            for(int i=0;i<10;i++)
            {
                for(int j=1;j<=9;j++)
                {
                    Console.Write("{0}*{1}={2:00}\t",j,i,i*j);
                }
                Console.WriteLine();
            }
            Console.WriteLine();
            Console.WriteLine("------------------左下角乘法表------------------");
            for(int i=1;i<10;i++)
            {
                for(int j=1;j<=i;j++)
                {
                    Console.Write("{0}*{1}={2:00}\t", j, i, i * j);
                }
                Console.WriteLine();
            }
            Console.WriteLine();
            Console.WriteLine("------------------左上角乘法表------------------");
            for(int i=9;i>0;i--)
            {
                for(int j=1;j<=i;j++)
                {
                    Console.Write("{0}*{1}={2:00}\t", j, i, i * j);
                }
                Console.WriteLine();
            }
            Console.WriteLine();
            Console.WriteLine("------------------右上角乘法表------------------");
            for(int i=9;i>0;i--)
            {
                for(int j=i;j>0;j--)
                {
                    Console.Write("{0:00}={1}*{2}\t", i * j, i, j);
                }
                Console.WriteLine();
                for(k=10-i;k>0;k--)
                {
                    Console.Write("\t");
                }
            }
            Console.WriteLine();
            Console.WriteLine("------------------右下角乘法表------------------");
            for(int i=1;i<10;i++)
            {
                for(k=9-i;k>0;k--)
                {
                    Console.Write("\t");
                }
                for(int j=i;j>0;j--)
                {
                    Console.Write("{0:00}={1}*{2}\t", i * j, j, i);
                }
                Console.WriteLine();
            }
            Console.WriteLine();

            #endregion
            #region
            /*
            int i = 1;
            while(i<=9)
            {
                int j = 1;
                while(j<=i)
                {
                    Console.Write("{0:00}x{1:00}={2:00} ",j, i,i*j);
                    j++;
                }
                i++;
                Console.WriteLine();
            }

            Console.ReadLine();
            */
            #endregion
            #region
            /*
            int i = 1;
            do
            {
                Console.Write("{0} ", i);
                i++;
            } while (i <= 6);
            Console.ReadLine();

            int i1 = 1;
            do
            {
                Console.Write("{0} ", i1);
                i1++;
            } while (i1 <= 12);
            Console.ReadLine();

            int i2 = 1;
            do
            {
                Console.Write("{0} ", i2);
                i2++;
            } while (i2 <= 18);
            Console.ReadLine();

            int i3 = 1;
            do
            {
                Console.Write("{0} ", i3);
                i3++;
            } while (i3 <= 24);
            Console.ReadLine();

            int i4 = 1;
            do
            {
                Console.Write("{0} ", i4);
                i4++;
            } while (i4 <= 30);
            Console.ReadLine();

            int i5 = 1;
            do
            {
                Console.Write("{0} ", i5);
                i5++;
            } while (i5 <= 36);
            Console.ReadLine();

            int i6 = 1;
            do
            {
                Console.Write("{0} ", i6);
                i6++;
            } while (i6 <= 42);
            Console.ReadLine();

            int i7 = 1;
            do
            {
                Console.Write("{0} ", i7);
                i7++;
            } while (i7 <= 48);
            Console.ReadLine();
            */
            #endregion
            int[] a = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            foreach(int i in a)
            {
                Console.Write("{0} ", i);
            }
            Console.ReadLine();

            int[] b = new int[1000];
            for(int i=0;i<1000;i++)
            {
                b[i] = i + 1;
            }
            int sum1 = 0;
            foreach(int j in b)
            {
                sum1 = sum1 + j;
            }
            Console.WriteLine("1~1000以内数字的和为：{0}",sum1);
            Console.ReadLine();
            Console.ReadKey();
        }
    }
}
